package homework05;

import java.util.Scanner;

class ArrayUtils{
	static class PairResult{
		private double min;
		private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}	
	}
	public static PairResult findMinMax(double[] values){
		PairResult X = new PairResult();
		X.max = values[0];
		X.min = values[0];
		for (int i = 0; i < values.length; i++) {
			if(X.max<values[i])					
				X.max = values[i];
			if(X.min>values[i])					
				X.min = values[i];
		}
		return X;
	}
}

public class Seven04{
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int n =in.nextInt();
		double[] d = new double[n];
		for (int i = 0; i < d.length; i++) {
			d[i] = in.nextDouble();
		}
		ArrayUtils A = new ArrayUtils();
		ArrayUtils.PairResult P = new ArrayUtils.PairResult();
		P = A.findMinMax(d);
		System.out.println(P.toString());
		System.out.println(ArrayUtils.PairResult.class);
	}
}